package com.rrd.spring.event;

import java.lang.annotation.*;

import org.springframework.context.ApplicationEvent;

/**
 * An annotation that can be used to annotate a method to mark that it should handle specific application context
 * events.
 * <p/>
 * This annotation can only be applied to methods that accept a single parameter of a type that extends {@link ApplicationEvent}
 * 
 * A sample usage:
 * {@code
 * 	class SampleBean{
 * 		@EventHandler
 * 		public void handleEvent(SpecialEvent event){
 * 			System.out.println("Event "+event+" handled");
 * 		}
 * 	}
 * }
 *
 * @author eugene_rachitskiy
 */
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@Target(ElementType.METHOD)
public @interface EventHandler {
}
